<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
var base = "${base}/";
</script>
<!--框架必需-->
<script type="text/javascript" src="${base}/scripts/plugins/jquery-1.7.1.js"></script>
<script type="text/javascript" src="${base}/scripts/framework.js"></script>
<link href="${base}/css/import_basic.css" rel="stylesheet" type="text/css"/>
<link href="${base}/css/sky/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/scripts/text/text-overflow.js"></script>
<!--引入弹窗组件-->
<script type="text/javascript" src="${base}/scripts/attention/zDialog/zDrag.js"></script>
<script type="text/javascript" src="${base}/scripts/attention/zDialog/zDialog.js"></script>
<script type="text/javascript">
$(function() {
	if (document.cookie.indexOf("show=1") != -1) {
		top.Dialog.close();
		document.cookie="show=0";
	}
});
function openWinAdd(){
	var diag = new top.Dialog();
	diag.Title = "添加客户";
	diag.URL = "${base}/admin/customer/add.action";
	diag.Width=550;
	diag.Height=550;
	diag.CancelEvent = function(){
		diag.innerFrame.contentWindow.location.reload();
		diag.close();
		document.cookie="show=0";
	};
	diag.show();
	document.cookie="show=1";
}
</script>
</head>
<body>
<div class="position" id="top_list">
	<div class="center">
	<div class="left">
	<div class="right">
		<span>当前位置：客户管理 >> 客户列表</span>
	</div>	
	</div>	
	</div>
</div>
<div id="hbox">
	<div class="bs_nav">
		<div class="bs_navleft">
		    <ul>
		    	<form action="${base}/admin/customer/findByKeyWord.action" method="post" target="frmright">
		    	<li><span class="img_find"></span></li>
				<li>
					<select name="searchType">
						<option value="userName">按客户呢称查询</option>
						<option value="realName">按真实姓名查询</option>
						<option value="phoneNumber">按联系电话查询</option>
						<option value="address">按联系地址查询</option>
						<option value="habit">按客户习惯查询</option>
						<option value="wangWang">按阿里旺旺查询</option>
						<option value="qqNumber">按QQ号码查询</option>
					</select>
				</li>
				<li><input type="text" style="width:120px;" name="keyWord" value="${(keyWord)!''}"/></li>
				<li><input type="submit" class="button" value="查询"/></li>
				</form>
			</ul>
		</div>
		<div class="bs_navright">
			<a onclick="openWinAdd()"><span class="icon_add">新增客户</span></a>
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
	</div>
</div>
<div id="scrollContent" class="border_gray">
<table class="tableStyle">
	<tr>
		<th width="10%" class="th-title">客户名称</th>
		<th width="10%" class="th-title">真实姓名</th>
		<th width="4%" class="th-title">性别</th>
		<th width="10%" class="th-title">联系电话</th>
		<th width="10%" class="th-title">联系地址</th>
		<th width="10%" class="th-title">电子邮箱</th>
		<th width="7%" class="th-title">QQ号码</th>
		<th width="6%" class="th-title">交易次数</th>
		<th width="7%" class="th-title">会员等级</th>
		<th width="6%" class="th-title">会员积分</th>
		<th width="10%" class="th-title">客户习惯</th>
		<th width="10%" class="th-title">操作</th>
	</tr>
	<#if (customerList??) && (customerList?size>0)>
		<#list customerList as customer>
		<tr>
			<td>${(customer.userName)!''}</td>
			<td>${(customer.realName)!''}</td>
			<#if customer.gender = 0 >
			<td>男</td>
			<#else>
			<td>女</td>
			</#if>
			<td>${(customer.telephone)!''}</td>
			<td>
				<span class="text_slice" style="width: 110px;" title="${(customer.address)!''}">${(customer.address)!''}</span>
			</td>
			<td>${(customer.email)!''}</td>
			<td>${(customer.qqNumber)!''}</td>
			<td>${(customer.tradeCount)!'0'}</td>
			<td>${(customer.credit.description)!'普通会员'}</td>
			<td>${(customer.pointValue)!''}</td>
			<td>
				<span class="text_slice" style="width: 100px;" title="${(customer.habit)!''}">${(customer.habit)!''}</span>
			</td>
			<td>
				<a onclick="openWinFind(${(customer.id)!0})"><span class="icon_view">查看</span></a>
				<a onclick="openWinUpdate(${(customer.id)!0})"><span class="icon_edit">修改</span></a>
				<a href="#"><span class="icon_key">锁定</span></a>
				<a href="javascript:void(0)" onclick="select(${(customer.id)!0})"><span class="icon_delete">选中</span></a>
			</td>
		</tr>
		</#list>
	<#else>
		<tr>
			<td colspan="13">暂无客户信息记录</td>
		</tr>
	</#if>
</table>
<#include "/WEB-INF/tool/pager.ftl">
</div>
</body>
</html>
<script type="text/javascript" src="${base}/js/select-customer.js"></script>